<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>供需对接服务系统--项目发布（内部）</title>
    <!--公用样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/supplier/common/css/comment.css"/>
    <!--页面样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/supplier/common/css/style.css"/>
    <!--Layui-->
    <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css" media="all"/>
    <!--extended-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/extended.css"/>
    <!--公用样式JS-->
    <script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
    <script type="text/javascript" src="${re.contextPath}/plugin/supplier/common/js/tel.js" charset="utf-8"></script>
</head>
<style>
    .Right {
        width: 100%;
        overflow-y: scroll;
    }
    .clearfix.whitebg.mt20{
        text-align: right;
    }
    .release ul:nth-child(2) li label {
        /*width: 28%;*/
        margin-right: 3%;
        width: 20%;
    }

    .release ul:first-child li label {
        width: 23%;
    }

    .release .address, .personnel .address {
        width: 65%;
    }
    .layui-anim-upbit {
        min-width: 80%!important;
        width: 80% !important;
        left: 10%!important;
    }

</style>

<body>
<!--头部-->
<header class="whitebg"></header>
<!--容器-->
<div class="container clearfix">
    <!--占位-->
    <!--右侧内容-->
    <div class="Right fr mt10">
        <form class="layui-form" id="myForm" style="margin-left: 20px;">
            <div id="lc_img_left" class="cursor" style="text-align: right;margin-right: 41px;">
                <a style="color: blue;"
                        onclick="handbook()"><img src="${re.contextPath}/plugin/common/images/wh.png"  style="width: 24px"> 发布指南</a></div>
            <div class="release">
                <ul class="clearfix whitebg">
                    <li class="clearfix">
                        <label class="fl">发布单位<span class="red">*</span> </label>
                        <input type="text" class="fl" id="publishCompanyname" lay-maxlength="30"
                               value="${baseCompany.bcName}" readonly="readonly"   style="width: 70%;"
                               lay-verify="notnull|maxlength">
                        <input type="hidden" class="fl" id="publishCompany" name="publishCompany" lay-maxlength="30"
                               value="${baseCompany.bcId}" readonly="readonly"
                               lay-verify="required|maxlength">
                        <input type="hidden" id="supProjectId">
                    </li>
                    <li class="clearfix">
                        <label class="fl">发布人<span class="red">*</span> </label>
                        <input type="hidden" class="fl" id="publishBy" name="publishBy" value="${user.id}"
                        >
                        <input type="text" class="fl" lay-maxlength="100" value="${user.realName}" readonly="readonly"
                               lay-verify="notnull|maxlength">

                    </li>
                    <li class="clearfix">
                        <label class="fl">联系电话<span class="red">*</span> </label>
                        <input type="text" name="linkTel" id="linkTel" lay-verify="notnull|phoneNumber"
                               value="${user.phoneNumber}">
                    </li>
                </ul>
                <ul class="clearfix whitebg mt20">
                    <li class="clearfix">
                        <label class="fl">项目名称<span class="red">*</span> </label>
                        <input type="text" style="width: 50%;" class="fl" id="projectName" name="projectName"  autocomplete="off"
                               lay-maxlength="200"
                               lay-verify="notnull|maxlength">
                        <button type="button" class="bluebg white bor0 ml10" id="oaselecttable" onclick="_crt_page.events.chooseOaProject()">选择</button>
                        <button type="button" class="garybbg white bor0 ml10 " style="display: none"
                                onclick="_crt_page.events.clearSelect(this)"
                                id="clearoaselecttable">清除
                        </button>
                        <input type="hidden" name="oaId" id="oaId">
                        <input type="hidden" name="jlHtName" id="jlHtName">
                    </li>
                    <li class="clearfix">
                        <label class="fl">项目类型<span class="red">*</span> </label>
                        <div class="category clearfix  xmlxdiv">
                            <#list projectTypeList as vo>
                                <#if "${vo.badtCode}"=="001">
                                    <input type="checkbox" class="fl h15 w25 " name="projectType${vo_index}"
                                           value="${vo.badtCode}" onchange="_crt_page.events.xmlxChange(this)"
                                           lay-ignore>
                                <#else >
                                    <input type="checkbox" class="fl h15 w25 " name="projectType${vo_index}"
                                           value="${vo.badtCode}" onchange="_crt_page.events.xmlxChange(this)"
                                           lay-ignore>
                                </#if>
                                <span class="fl mr10">${vo.badtName}</span>
                            </#list>
                        </div>
                    </li>

                    <li class="clearfix">
                        <label class="fl"  style="width: 21%;">项目建设总投资<span class="red">*</span></label>
                        <input type="text" class="fl unit-ind-1" name="tzMoney" id="tzMoney" lay-maxlength="20"
                               lay-verify="required|decimal|maxlength">
                        <span class="fl ml10">元</span>
                    </li>
                    <li class="clearfix">
                        <label class="fl">合同金额<span class="red">*</span></label>
                        <input type="text" class="fl unit-ind-1" name="htMoney" id="htMoney" lay-maxlength="20"
                               lay-verify="required|decimal|maxlength">
                        <span class="fl ml10">元</span>
                    </li>

                    <li class="clearfix lx001 hide">
                        <label class="fl"  style="width: 20%;">监理方式</label>
                        <#--                        <input type="text" class="fl unit-ind-1" name="supervisorWay" id="supervisorWay">-->
                        <select class="fl" id="supervisorWay" name="supervisorWay" lay-ignore>
                            <option value="">请选择</option>
                            <#list checkShapeList as csl>
                                <option value="${csl.badtCode}">${csl.badtName}</option>
                            </#list>
                        </select>
                    </li>

                    <li class="clearfix lx001 hide">
                        <label class="fl">监理服务费<span class="red">*</span></label>
                        <input type="text" class="fl unit-ind-1" name="jlFwMoney" id="jlFwMoney" lay-maxlength="20"

                               onblur="_crt_page.events.ssfybulur(this)">
                        <span class="fl ml10">元</span>
                    </li>
                    <li class="clearfix lx001 hide">
                        <label class="fl">监理实施费用<span class="red">*</span></label>
                        <input type="text" class="fl unit-ind-1" name="jlSsMoney" id="jlSsMoney" lay-maxlength="20"
                               readonly="readonly" >
                        <span class="fl ml10">元</span>
                    </li>
                    <li class="clearfix lx002 hide">
                        <label class="fl">咨询服务费<span class="red">*</span></label>
                        <input type="text" class="fl unit-ind-1" name="zxFwMoney" id="zxFwMoney" lay-maxlength="20"
                               onblur="_crt_page.events.ssfybulur(this)">
                        <span class="fl ml10">元</span>
                    </li>
                    <li class="clearfix lx002 hide">
                        <label class="fl">咨询实施费用<span class="red">*</span></label>
                        <input type="text" class="fl unit-ind-1" name="zxSsMoney" id="zxSsMoney" lay-maxlength="20"
                               readonly="readonly"
                        >
                        <span class="fl ml10">元</span>
                    </li>
                    <li class="clearfix lx003 hide">
                        <label class="fl">检测服务费<span class="red">*</span></label>
                        <input type="text" class="fl unit-ind-1" name="jcFwMoney" id="jcFwMoney" lay-maxlength="20"
                               onblur="_crt_page.events.ssfybulur(this)">
                        <span class="fl ml10">元</span>
                    </li>
                    <li class="clearfix lx003 hide">
                        <label class="fl">检测实施费用<span class="red">*</span></label>
                        <input type="text" class="fl unit-ind-1" name="jcSsMoney" id="jcSsMoney" lay-maxlength="20"
                               readonly="readonly"
                        >
                        <span class="fl ml10">元</span>
                    </li>
                    <li class="clearfix lx100 hide">
                        <label class="fl">其他服务费<span class="red">*</span></label>
                        <input type="text" class="fl unit-ind-1" name="qtFwMoney" id="qtFwMoney" lay-maxlength="20"
                               onblur="_crt_page.events.ssfybulur(this)">
                        <span class="fl ml10">元</span>
                    </li>
                    <li class="clearfix lx100 hide">
                        <label class="fl">其他实施费用<span class="red">*</span></label>
                        <input type="text" class="fl unit-ind-1" name="qtSsMoney" id="qtSsMoney" lay-maxlength="20"
                               readonly="readonly"
                               lay-verify="">
                        <span class="fl ml10">元</span>
                    </li>
                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">无人应接<span class="red">*</span></label>
                        <input type="text" class="fl unit-ind-1" name="days" id="days"value="0"
                               lay-verify="required|decimalDay">
                        <span class="fl ml10">天增加费用</span>
                    </li>
                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">公示天数<span class="red">*</span></label>
                        <input type="text" class="fl unit-ind-1" name="gsDays" id="gsDays" value="1"
                               lay-verify="required|decimalDay">
                        <span class="fl ml10">天</span>
                    </li>
                    <#-- ============================================================================================-->
                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">合同编号</label>
                        <input type="text" class="fl unit-ind-1" name="contractNo"  id="contractNo">
                    </li>
                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">内部合同编号<span class="red">*</span></label>
                        <input type="text" class="fl unit-ind-1" lay-verify="required" name="insideContractNo" id="insideContractNo">
                    </li>
                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">采购/项目编号</label>
                        <input type="text" class="fl unit-ind-1" name="payOrProjectNo" id="payOrProjectNo">
                    </li>
                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">客户名称<span class="red">*</span></label>
                        <input type="text" class="fl unit-ind-1" name="owerCompany" lay-verify="required" id="owerCompany">
                    </li>
                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">客户联系人</label>
                        <input type="text" class="fl unit-ind-1" name="projectLeader" id="projectLeader">
                    </li>

                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">联系人电话</label>
                        <input type="text" class="fl unit-ind-1" name="khlxrPhone" id="khlxrPhone">
                    </li>
                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">联系人邮箱</label>
                        <input type="text" class="fl unit-ind-1" name="khlxrEmail" id="khlxrEmail">
                    </li>

                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">联系人职务</label>
                        <input type="text" class="fl unit-ind-1" name="duty" id="duty">
                    </li>
                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">中标信息查询网址</label>
                        <input type="text" class="fl unit-ind-1" name="queryWeb" id="queryWeb">
                    </li>
                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">项目归属<span class="red">*</span></label>
                        <select class="fl" id="projectOwner" name="projectOwner" lay-verify="required" lay-ignore>
                            <option value="">请选择</option>
                            <#list comlistOwner as vo>
                                <option value="${vo.bcId}">${vo.bcName}</option>
                            </#list>
                        </select>
                    </li>
                    <#-- ============================================================================================-->
                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">项目范围</label>
                        <input type="text" class="fl unit-ind-1" name="projectScope" id="projectScope">
                    </li>

                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">项目预算</label>
                        <input type="text" class="fl unit-ind-1" name="projectYs" id="projectYs">
                    </li>

                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">付款条件</label>
                        <input type="text" class="fl unit-ind-1" name="paymentClause" id="paymentClause">
                    </li>

                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">承诺(口头)</label>
                        <input type="text" class="fl unit-ind-1" name="ktcn" id="ktcn">
                    </li>

                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">人数沟通</label>
                        <input type="text" class="fl unit-ind-1" name="rsgt" id="rsgt">
                    </li>

                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">质保期长</label>
                        <input type="text" class="fl unit-ind-1" name="zbq" id="zbq">
                    </li>

                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">预计进场时间</label>
                        <input type="text" class="fl" style="width: 50%;" autocomplete="off" placeholder="选择预计进场时间" name="ydyjjcTime" id="ydyjjcTime">
                    </li>

                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">引见时间</label>
                        <input type="text" class="fl" style="width: 50%;" autocomplete="off" placeholder="选择引见时间" name="yjTime" id="yjTime">
                    </li>

                    <li class="clearfix">
                        <label class="fl"  style="width: 20%;">工期</label>
                        <input type="text" class="fl unit-ind-1" name="gqReq" id="gqReq"      >
<#--                        <span class="fl ml10">月</span>-->
                    </li>
                    <li class="clearfix">
                        <label class="fl">招标截止时间<span class="red">*</span></label>
                        <input type="text" class="fl" style="width: 50%;" name="zbEndDate" placeholder="选择时间"
                               lay-verify="required"
                               autocomplete="off" id="zbEndDate" lay-verify="zbEndDate">
                    </li>
                    <li class="clearfix">
                        <label class="fl">合同签订地点<span class="red">*</span></label>
                        <div style="text-align: left;">
                        <select name="htSignProvince" class="ml8" id="htsignprovince" style="width:90px !important;"
                                onchange="_crt_page.events.provinceChange(this)"
                                lay-verify="required" lay-ignore>
                            <option value="">请选择</option>
                            <#list provincelist as vo>
                                <option value="${vo.code}">${vo.name}</option>
                            </#list>
                        </select>
                        <select name="htSignCity" id="htsigncity" class="ml8" lay-verify="required"
                                onchange="_crt_page.events.cityChange(this)"
                                style="width: 90px !important;margin-left: 10px" lay-ignore>
                            <option value="">请选择</option>
                        </select>
                        <select name="htSignCounty" id="htsigncounty" class="ml8" lay-filter="htsigncounty"
                                lay-verify="required"
                                style="width:90px !important;margin-left: 10px" lay-ignore>
                            <option value="">请选择</option>
                        </select>
                        </div>
                    </li>
                    <li class="clearfix">
                        <label class="fl">行业类型<span class="red">*</span></label>
                        <select class="fl" id="hyType" name="hyType" lay-verify="required" lay-ignore>
                            <option value="">请选择</option>
                            <#list hytypelist as vo>
                                <option value="${vo.badtCode}">${vo.badtName}</option>
                            </#list>
                        </select>
                    </li>
                    <li class="clearfix" >
                        <label class="fl" >实施地点</label>
                        <div class="address fl clearfix ssplace">
                            <div class="clearfix mt10 divplaceselect">
                                <select name="projectPlacedtos[0].province" class="ml8 fl" id="placeprovince0"
                                        onchange="_crt_page.events.provinceChange(this)" style="width:90px !important;" lay-ignore>
                                    <option value="">请选择</option>
                                    <#list provincelist as vo>
                                        <option value="${vo.code}">${vo.name}</option>
                                    </#list>
                                </select>
                                <select name="projectPlacedtos[0].city" id="placecity0" class="ml8 fl" lay-filter="city"
                                        onchange="_crt_page.events.cityChange(this)"
                                        style="width: 90px !important;margin-left: 10px" lay-ignore>
                                    <option value="">请选择</option>
                                </select>
                                <select name="projectPlacedtos[0].county" id="placecounty0" class="ml8 fl"
                                        lay-filter="county"
                                        style="width:90px !important;margin-left: 10px" lay-ignore>
                                    <option value="">请选择</option>
                                </select>
                                <img src="${re.contextPath}/plugin/common/images/77@2x.png"
                                     class="fl ml20 addplaceimage" onclick="_crt_page.events.addPlace(this)">
                                <img src="${re.contextPath}/plugin/common/images/76@2x.png" class="fl ml20"
                                     onclick="_crt_page.events.deletePlace(this)">
                            </div>
<#--                            <div class="clearfix mt10 divplaceselect">-->
<#--                                <select name="projectPlacedtos[1].province" class="ml8 fl" id="placeprovince1"-->
<#--                                        style="width:90px !important;" onchange="_crt_page.events.provinceChange(this)"-->
<#--                                        lay-verify="required" lay-ignore>-->
<#--                                    <option value="">请选择</option>-->
<#--                                    <#list provincelist as vo>-->
<#--                                        <option value="${vo.code}">${vo.name}</option>-->
<#--                                    </#list>-->
<#--                                </select>-->
<#--                                <select name="projectPlacedtos[1].city" id="placecity1" class="ml8 fl"-->
<#--                                        onchange="_crt_page.events.cityChange(this)"-->
<#--                                        lay-filter="projectPlacedtos[1].city" lay-verify="required"-->
<#--                                        style="width: 90px !important;margin-left: 10px" lay-ignore>-->
<#--                                    <option value="">请选择</option>-->
<#--                                </select>-->
<#--                                <select name="projectPlacedtos[1].county" id="placecounty1" class="ml8 fl"-->
<#--                                        lay-filter="projectPlacedtos[1].county" lay-verify="required"-->
<#--                                        style="width:90px !important;margin-left: 10px" lay-ignore>-->
<#--                                    <option value="">请选择</option>-->
<#--                                </select>-->
<#--                                <img src="${re.contextPath}/plugin/common/images/77@2x.png"-->
<#--                                     class="fl ml20 addplaceimage" onclick="_crt_page.events.addPlace(this)">-->
<#--                                <img src="${re.contextPath}/plugin/common/images/76@2x.png" class="fl ml20"-->
<#--                                     onclick="_crt_page.events.deletePlace(this)">-->
<#--                            </div>-->
                        </div>
                    </li>
                    <li class="clearfix divisgk" >
                        <label class="fl">是否对外公开<span class="red">*</span></label>
                        <div class="category clearfix ">
                            <input type="radio" class="fl h15 w25 " name="isGk" value="1" lay-verify="required"
                                   lay-ignore>
                            <span class="fl mr10">是</span>
                            <input type="radio" class="fl h15 w25 " name="isGk" value="0" lay-verify="required" checked
                                   lay-ignore>
                            <span class="fl mr10">否</span>
                        </div>
                    </li>
                    <li class="clearfix divneedzb" style="width: 60%;">
                        <label class="fl" style="width: 15%;margin-right: 2%;">是否需要招投标<span class="red">*</span></label>
                        <div class="category clearfix ">
                            <input type="radio" class="fl h15 w25 " name="needZb" value="1"
                                   onchange="_crt_page.events.needZtbChange(this)" lay-ignore>
                            <span class="fl mr10">是</span>
                            <input type="radio" class="fl h15 w25 " name="needZb" value="0"
                                   onchange="_crt_page.events.needZtbChange(this)" lay-ignore>
                            <span class="fl mr10">否</span>
                        </div>
                    </li>
                    <li class="clearfix  LIisZb" style="width: 60%;">
                        <label class="fl" style="width: 15%;margin-right: 2%;">是否已招标<span class="red">*</span></label>
                        <div class="category clearfix">
                            <input type="radio" class="fl h15 w25 " name="isZb" value="1"
                                   onchange="_crt_page.events.isZbChange(this)" lay-ignore>
                            <span class="fl mr10">是</span>
                            <input type="radio" class="fl h15 w25 " name="isZb" value="0"
                                   onchange="_crt_page.events.isZbChange(this)" lay-ignore>
                            <span class="fl mr10">否</span>
                        </div>
                    </li>
                    <li class="clearfix  LIqdHt" style="width: 60%;">
                        <label class="fl" style="width: 15%;margin-right: 2%;">是否已签合同<span class="red">*</span></label>
                        <div class="category clearfix">
                            <input type="radio" class="fl h15 w25 " name="qdHt" value="1"
                                   onchange="_crt_page.events.qdHtChange(this)" lay-ignore>
                            <span class="fl mr10">是</span>
                            <input type="radio" class="fl h15 w25 " name="qdHt" value="0"
                                   onchange="_crt_page.events.qdHtChange(this)" lay-ignore>
                            <span class="fl mr10">否</span>
                        </div>
                    </li>
                    <li class="clearfix  sfk" style="width:60%;">
                        <label class="fl" style="width: 15%;margin-right: 2%;">是否有首付款<span class="red">*</span></label>
                        <div class="category clearfix">
                            <input type="radio" class="fl h15 w25 " name="isSfk" value="1" lay-ignore>
                            <span class="fl mr10">是</span>
                            <input type="radio" class="fl h15 w25 " name="isSfk" value="0" lay-ignore>
                            <span class="fl mr10">否</span>
                        </div>
                    </li>
                    <li class="clearfix  htqdhj">
                        <label class="fl">合同签订时间<span class="red">*</span></label>
                        <input type="text" class="fl" style="width: 50%;" name="htSignDate" placeholder="选择时间"
                               autocomplete="off" id="htSignDate">
                    </li>
                    <li class="clearfix">
                        <label class="fl" style="width: 8.5%;margin-right: 2%;">其他需求</label>
                        <textarea name="otherXq" id="otherXq" autocomplete="off" lay-maxlength="200"
                                  placeholder="请输入对项目的其他说明或需求,输入内容最大200个汉字" lay-verify="maxlength"></textarea>
                    </li>
                </ul>
            </div>
            <div class="personnel whitebg" style="text-align: right;">
                <div class="bold" style="text-align: left;">主要负责人要求</div>
                <ul>
                    <li class="clearfix">
                        <label class="fl" style="width: 8%;margin-right: 1%;">性别：</label>
                        <select name="mainFzSex" id="mainFzSex" class="fl" lay-ignore>
                            <option value="" selected>不限</option>
                            <option value="0">女</option>
                            <option value="1">男</option>
                        </select>
                    </li>
                    <li class="clearfix">
                        <label class="fl" style="width: 8%;margin-right: 1%;">学历：</label>
                        <select name="mainFzXl" id="mainFzXl" class="fl" lay-ignore>
                            <option value="" selected>不限</option>
                            <#list edulist as vo>
                                <option value="${vo.badtCode}">${vo.badtName}</option>
                            </#list>
                        </select>
                    </li>
                    <li class="clearfix">
                        <label class="fl" style="width: 8%;margin-right: 1%;">地区：</label>
                        <div class="address fl clearfix mainpersonplace">
                            <div class="clearfix mt10 divpersonplaceselect">
                                <select name="personPlacedtos[0].province" class="ml8 fl" id="personplaceprovince0"
                                        style="width:200px !important;" onchange="_crt_page.events.provinceChange(this)"
                                        lay-ignore>
                                    <option value="">请选择</option>
                                    <#list provincelist as vo>
                                        <option value="${vo.code}">${vo.name}</option>
                                    </#list>
                                </select>
                                <select name="personPlacedtos[0].city" id="personplacecity0" class="ml8 fl"
                                        lay-filter="city"
                                        style="width: 200px !important;margin-left: 10px" lay-ignore>
                                    <option value="">请选择</option>
                                </select>
                                <img src="${re.contextPath}/plugin/common/images/77@2x.png" class="fl ml20"
                                     onclick="_crt_page.events.addPersonPlace(this)">
                                <img src="${re.contextPath}/plugin/common/images/76@2x.png" class="fl ml20"
                                     onclick="_crt_page.events.deletePersonPlace(this)">
                            </div>
                        </div>
                    </li>
                    <li class="clearfix">
                        <label class="fl" style="width: 8%;margin-right: 1%;">擅长领域：</label>
                        <div class="category clearfix fl">
                            <#list doBestList as vo>
                                <div style="display: inline-block">
                                    <input type="checkbox" class="fl h15 w25 doBestInput" name="mainFzField"
                                           value="${vo.badtCode}" lay-ignore>
                                    <span class="fl mr10">${vo.badtName}</span>
                                </div>
                            </#list>
                        </div>
                    </li>
                    <li class="clearfix">
                        <label class="fl"style="width: 8%;margin-right: 1%;">需要出差：</label>
                        <select name="mainFzTrip" id="mainFzTrip" class="fl" lay-ignore>
                            <option value="0">否</option>
                            <option value="1">是</option>
                        </select>
                    </li>
                    <li class="clearfix">
                        <label class="fl" class="fl" style="width: 8%;">备注：</label>
                        <textarea style="margin-right: 39.8%;" placeholder="请输入备注,输入内容最大200个汉字" id="mainFzRemark" name="mainFzRemark"
                                  autocomplete="off" lay-maxlength="200" lay-verify="maxlength"></textarea>
                        <input type="hidden" class="fl h15 w25 " id="311finish" name="zbsmFinish" value="" lay-ignore>
                        <input type="hidden" class="fl h15 w25 " id="312finish" name="zbFinish" value="" lay-ignore>
                        <input type="hidden" class="fl h15 w25 " id="313finish" name="tbFinish" value="" lay-ignore>
                        <input type="hidden" class="fl h15 w25 " id="314finish" name="htFinish" value="" lay-ignore>
                        <input type="hidden" class="fl h15 w25 " id="315finish" name="htsmFinish" value="" lay-ignore>
                    </li>
                </ul>
            </div>
            <div class="downModule whitebg mt30">
                <ul>
                    <li class="uploadli upload_zbwjsmw_li  hide">
                        <div class="clearfix upload_oper_div">
                            <div class="downModuleTip clearfix fl">

                                <span class="fl mt10"><strong>上传项目招标文件说明文件</strong>(项目招标说明文件上传的文件名称必须包含“招标“和”说明”字样)</span>
                            </div>
                            <div class="downModuleBtn clearfix fr">
                                <img src="${re.contextPath}/plugin/common/images/18@2x.png" class="file-upload fl"
                                     filedata="{'type':'311','projectType':'002'}" alt="" class="fl">
                                <img src="${re.contextPath}/plugin/common/images/19@2x.png" alt=""
                                     onclick="_crt_page.events.delFile(this)" class="fl">
<#--                                <button class="fl bluebg white fl ml20 upfinish" type="button" lay-ignore=""-->
<#--                                        onclick="_crt_page.events.finishfile(this)">完成-->
<#--                                </button>-->
                            </div>
                        </div>
                        <ul>
                        </ul>
                    </li>
                    <li class="uploadli upload_zbwj_li  hide ">
                        <div class="clearfix upload_oper_div">
                            <div class="downModuleTip clearfix fl">

                                <span class="fl mt10"><strong>上传项目招标文件</strong>(项目招标文件上传的文件名称必须包含“招标”字样)</span>
                            </div>
                            <div class="downModuleBtn clearfix fr">
                                <img src="${re.contextPath}/plugin/common/images/18@2x.png" class="file-upload fl"
                                     filedata="{'type':'312','projectType':'002'}" alt="" class="fl">
                                <img src="${re.contextPath}/plugin/common/images/19@2x.png" alt=""
                                     onclick="_crt_page.events.delFile(this)" class="fl">
<#--                                <button class="fl bluebg white fl ml20 upfinish" type="button"-->
<#--                                        onclick="_crt_page.events.finishfile(this)">完成-->
<#--                                </button>-->
                            </div>
                        </div>
                        <ul>
                        </ul>
                    </li>
                    <li class="uploadli  upload_tbwj_li  hide">
                        <div class="clearfix upload_oper_div">
                            <div class="downModuleTip clearfix fl">

                                <span class="fl mt10"><strong>上传项目投标文件</strong>(项目投标文档上传的文件名称必须包含“投标”字样)</span>
                            </div>
                            <div class="downModuleBtn clearfix fr">
                                <img src="${re.contextPath}/plugin/common/images/18@2x.png" class="file-upload fl"
                                     filedata="{'type':'313','projectType':'002'}" alt="" class="fl">
                                <img src="${re.contextPath}/plugin/common/images/19@2x.png" alt=""
                                     onclick="_crt_page.events.delFile(this)" class="fl">
<#--                                <button class="fl bluebg white fl ml20 upfinish" type="button"-->
<#--                                        onclick="_crt_page.events.finishfile(this)">完成-->
<#--                                </button>-->
                            </div>
                        </div>
                        <ul>
                        </ul>
                    </li>
                    <li class="uploadli upload_ht_li hide ">
                        <div class="clearfix upload_oper_div">
                            <div class="downModuleTip clearfix fl">

                                <span class="fl mt10"><strong>上传合同</strong>(合同文件上传的文件名称必须包含“合同”字样，且为PDF格式)</span>
                            </div>
                            <div class="downModuleBtn clearfix fr">
                                <img src="${re.contextPath}/plugin/common/images/18@2x.png" class="file-upload fl"
                                     filedata="{'type':'314','projectType':'002'}" alt="" class="fl">
                                <img src="${re.contextPath}/plugin/common/images/19@2x.png"
                                     onclick="_crt_page.events.delFile(this)" alt="" class="fl">
<#--                                <button class="fl bluebg white fl ml20 upfinish" type="button"-->
<#--                                        onclick="_crt_page.events.finishfile(this)">完成-->
<#--                                </button>-->
                            </div>
                        </div>
                        <ul>
                        </ul>
                    </li>
                    <li class="uploadli  upload_htsmwj_li hide ">
                        <div class="clearfix upload_oper_div">
                            <div class="downModuleTip clearfix fl">

                                <span class="fl mt10"><strong>上传合同说明文件</strong>(合同说明文件上传的文件名称必须包含“合同"和"说明”字样)</span>
                            </div>
                            <div class="downModuleBtn clearfix fr">
                                <img src="${re.contextPath}/plugin/common/images/18@2x.png" class="file-upload fl"
                                     filedata="{'type':'315','projectType':'002'}" alt="" class="fl">
                                <img src="${re.contextPath}/plugin/common/images/19@2x.png"
                                     onclick="_crt_page.events.delFile(this)" alt="" class="fl">
<#--                                <button class="fl bluebg white fl ml20 upfinish" type="button"-->
<#--                                        onclick="_crt_page.events.finishfile(this)">完成-->
<#--                                </button>-->
                            </div>
                        </div>
                        <ul>
                        </ul>
                    </li>
                    <li class="uploadli  upload_zbtzs_li hide ">
                        <div class="clearfix upload_oper_div">
                            <div class="downModuleTip clearfix fl">

                                <span class="fl mt10"><strong>上传中标通知书(可选)</strong></span>
                            </div>
                            <div class="downModuleBtn clearfix fr">
                                <img src="${re.contextPath}/plugin/common/images/18@2x.png" class="file-upload fl"
                                     filedata="{'type':'316','projectType':'002'}" alt="" class="fl">
                                <img src="${re.contextPath}/plugin/common/images/19@2x.png"
                                     onclick="_crt_page.events.delFile(this)" alt="" class="fl">
                            </div>
                        </div>
                        <ul>
                        </ul>
                    </li>
                </ul>
            </div>
            <input type="hidden" name="contractDays" id="contractDays" value="">
            <input type="hidden" name="contractDate" id="contractDate" value="">
            <div class="releaseBtn center">
                <button type="submit" lay-submit lay-filter="save" class="bluebg white ft18"
                        onclick="resetRequired()" id="btnsave">保存</button>
                <button type="submit" lay-submit lay-filter="submit" class="bluebg white ft18"
                        onclick="resetRequiredSubmit()" id="btnsubmit">提交
                </button>
            </div>
        </form>

    </div>
</div>


<!--公用样式JS-->
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
<!--启动JS-->
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/jquery.boot.js"></script>
<!--启动JS-->
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/jquery.common.js"></script>
<script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js"></script>
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/form.file.js"></script>
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/supplier/common/js/fileoper.js"></script>
<script>
    var tableSelect_already = false;
    var _oa_data = [];
    var getDataLoading;
    var auto_clicked = false;
</script>
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/layui/lay/modules/tableSelect.js"></script>

<!-- 公共配置第三方组件 -->
<script type="text/javascript">
    layui.config({
        version: false,
        debug: false,
        base: "${re.contextPath}/plugin/layui/lay/extra/"
    })
</script>

<script>
    var layer, form, laydate, table, autocomplete, tableSelect;
    var _crt_page;
    layui.use(['form', 'laydate', 'layer', 'autocomplete', 'tableSelect'], function () {
        layer = layui.layer;
        form = layui.form;
        laydate = layui.laydate;
        tableSelect = layui.tableSelect;

        $('.close').click(function () {
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
        });
        form.verify({
            maxlength: function (v, item) {
                var maxlength = item.getAttribute('lay-maxlength');
                if (v.trim() != '') {
                    if (v.trim().length > maxlength) {
                        return "输入长度不能大于" + maxlength + "个字符！";
                    }
                }
            },
            phoneNumber: function (v) {
                if (v.trim() == '') {
                    return '手机号不能为空';
                } else {
                    if (!v.trim().isMobile() && !v.trim().isTel()) {
                        return '请输入正确的手机号码或电话号码\n\n例如:13916752109或0531-3614072';
                    }
                }
            },
            number: function (v) {
                if (v.trim() == '') {
                    return;
                }
                var reg = /^[0-9]*$/;
                var flag = reg.test(v.trim());
                if (!flag) {
                    return '请输入正确的数字';
                }
            },
            decimal: function (v) {
                if (v.trim() == '') {
                    return;
                }
                var reg = /^-?([0-9]+|[0-9]{1,3}(,[0-9]{3})*)(.[0-9]{1,2})?$/;
                var flag = reg.test(v.trim());
                if (!flag) {
                    return '请输入正确的金额,支持小数点后两位';
                }
            },
            decimalDay: function (v) {
                if (v.trim() == '') {
                    return;
                }
                var reg = /^-?([0-9]+|[0-9]{1,3}(,[0-9]{3})*)(.[0-9]{1,2})?$/;
                var flag = reg.test(v.trim());
                if (!flag) {
                    return '请输入正确的天数';
                }
            },
            perdecimal: function (v) {
                if (v.trim() == '') {
                    return;
                }
                var reg = /^[1-9][0-9]*([.][0-9]+)?$/;
                var flag = reg.test(v.trim());
                if (!flag) {
                    if (v.trim() != "0" || v.trim() != 0) {
                        return '请输入数字';
                    }
                }
            },
            required: function () {

            },
            notnull: function (v, obj) {
                if (v == "") {
                    var str = $(obj).prev().text()
                    console.log(str)
                    return str + "必填项不能为空";
                }
            }
        })
        _crt_page = {
            init: function () {
                //初始化事件
                _crt_page.events._init();
                //初始化Form
                form.on('submit(save)', _crt_page.forms.save);
                form.on('submit(submit)', _crt_page.forms.commit);
            },
            forms: {
                save: function (data) {
                    $('#btnsave').addClass("layui-btn-disabled").attr("disabled",true);
                    $('#btnsubmit').addClass("layui-btn-disabled").attr("disabled",true);
                    var istg = _crt_page.events.saveBeforeBjy(data);
                    if (istg) {
                        data.field.status = "001";
                        var supProjectId = $("#supProjectId").val();
                        data.field.supProjectId = supProjectId;
                            layerAjax('/supplier/projectManager/addSave', data.field, '', function (d) {
                                if (d.flag == true) {
                                    $("#supProjectId").val(d.data);
                                    layer.msg(d.msg, {icon: 1});
                                    setTimeout(tzym,2000);
                                } else {
                                    layer.msg(d.msg, {icon: 2});
                                    $('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
                                    $('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
                                }
                            });
                    }
                    return false;
                },
                commit: function (data) {
                    var istg = _crt_page.events.saveBefore(data);
                    if (istg) {
                        data.field.status = "002";
                        var supProjectId = $("#supProjectId").val();
                        var url = '/supplier/projectManager/addSave';
                        if (supProjectId) {
                            //保存之后又点击提交
                            data.field.supProjectId = supProjectId;
                        }
                        if(data.field.jlFwMoney && Number(data.field.jlFwMoney)<=0){
                            $('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
                            $('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
                            layer.msg('监理服务费金额不正确', {icon: 2});return false;
                        }
                        if(data.field.zxFwMoney && Number(data.field.zxFwMoney)<=0){
                            $('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
                            $('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
                            layer.msg('咨询服务费金额不正确', {icon: 2});return false;
                        }
                        if(data.field.jcFwMoney && Number(data.field.jcFwMoney)<=0){
                            $('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
                            $('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
                            layer.msg('检测服务费金额不正确', {icon: 2});return false;
                        }
                        if(data.field.qtFwMoney && Number(data.field.qtFwMoney)<=0){
                            $('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
                            $('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
                            layer.msg('其他服务费金额不正确', {icon: 2});return false;
                        }
                        if (data.field.tzMoney && Number(data.field.tzMoney)<0){
                            $('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
                            $('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
                            layer.msg('项目建设总投资金额不正确', {icon: 2});return false;
                        }
                        if (data.field.htMoney && Number(data.field.htMoney)<=0){
                            $('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
                            $('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
                            layer.msg('合同金额不正确', {icon: 2});return false;
                        }
                        var sum = data.field.htMoney;
                        var fwMoney = Number(data.field.jlFwMoney) + Number(data.field.zxFwMoney) + Number(data.field.jcFwMoney) + Number(data.field.qtFwMoney);
                        if (sum != fwMoney) {
                            $('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
                            $('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
                            layer.msg('请填写正确的合同金额，合同金额应该等于所有类型服务费之和', {icon: 2});
                        } else {
                            layerAjax(url, data.field, '', function (d) {
                                if (d.flag == true) {
                                    $("#supProjectId").val(d.data);
                                    layer.msg("提交成功，请耐心等待平台审核", {icon: 1});
                                    $('#btnsave').addClass("layui-btn-disabled").attr("disabled", true);
                                    $('#btnsubmit').addClass("layui-btn-disabled").attr("disabled", true);
                                    setTimeout(tzym,2000);
                                } else {
                                    $('#btnsave').removeClass("layui-btn-disabled").attr("disabled", false);
                                    $('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled", false);
                                    layer.msg(d.msg, {icon: 2});
                                }
                            });
                        }
                    }
                    return false;
                }

            },
            events: {
                _init: function () {
                    form.on('submit(save)', _crt_page.forms.create);
                    form.on('submit(submit)', _crt_page.forms.commit);
                    _crt_page.events.gqdateInit();
                    _crt_page.events.uploadInit();
                    _crt_page.events.oabindSelectInit();
                },
                gqdateInit: function () {
                    // 工期开始时间
                    laydate.render({
                        elem: '#gqBeginDate',
                        trigger: 'click',
                        done: function (value, date) {
                            var that = $(this.elem[0])
                            console.log(that);
                            var endDate = $("#gqEndDate").val();
                            if (endDate && endDate < value) {
                                layer.msg("开始时间不能大于结束时间", {icon: 2});
                                $(that).val("");
                                return;
                            }
                        }
                    });
                    // 工期截止时间
                    laydate.render({
                        elem: '#gqEndDate',
                        trigger: 'click',
                        done: function (value, date) {
                            var that = $(this.elem[0])
                            console.log(that);
                            var startDate = $("#gqBeginDate").val();
                            if (startDate && startDate > value) {
                                layer.msg("结束时间不能小于开始时间", {icon: 2});
                                $(that).val("");
                                return;
                            }
                        }
                    });
                    // 招标截止时间
                    laydate.render({
                        elem: '#zbEndDate',
                        trigger: 'click',
                        type: 'datetime',
                        format: 'yyyy-MM-dd HH:mm'

                    });
                    // 合同签订时间
                    laydate.render({
                        elem: '#htSignDate',
                        trigger: 'click',
                    });

                    // 预计进场时间
                    laydate.render({
                        elem: '#ydyjjcTime',
                        trigger: 'click',
                    });

                    // 引见时间
                    laydate.render({
                        elem: '#yjTime',
                        trigger: 'click',
                    });

                },
                uploadInit: function () {
                    $(".upfinish").addClass("layui-btn-disabled").attr("disabled", true);
                    var tempFileIds = [];
                    $.each($('.file-upload'), function (i, e) {
                        //绑定一个个上传文件:
                        var fileDataStr = $(e).attr('filedata');
                        //至少fileData中需要有文件的类型编码
                        var fileData = eval('(' + fileDataStr + ')');
                        var fileContainer = $(e).parents(".upload_oper_div").next();
                        var type = fileData.type;
                        var ext = '';
                        // if (type == '311') {
                        //     //书著文件,只能上传文档
                        //     ext = 'doc|docx';
                        // } else if (type == '312') {
                        //     //扫描件,只能上传pdf
                        //     ext = 'doc|docx|pdf';
                        // } else if (type == '313') {
                        //     ext = 'doc|docx|pdf';
                        // } else if (type == '314') {
                        //     ext = 'pdf';
                        // } else if (type == '315') {
                        //     ext = 'doc|docx';
                        // }
                        //上传组件参数自定义:
                        var uploadPara = {
                            elem: $(e),
                            accept: 'file',
                            temp: "1",
                            exts: ext,
                            before: function (res) {
                                this.data = fileData;
                            },
                            done: function (res) {
                                if (res.flag) {
                                    var newFileId = res.data.id;
                                    var type = res.data.type + '';
                                    var newIndex = $('.form-file-div').length * 1;
                                    layer.msg("上传成功", {icon: 1});
                                    if (type == '315') {
                                        setTimeout(function () {
                                            layer.open({
                                                id: 1,
                                                type: 1,
                                                title: '填写合同预计上传天数',
                                                style: 'width:80%;height:auto;',
                                                content: "<div style='display:flex;justify-content:center;'><input type='text' id='area' placeholder='天数' style='width:88%;height:40px;margin-top:11px;'/></div>",
                                                btn: ['确定', '取消'],
                                                yes: function (index, layero) {
                                                    //获取输入框里面的值
                                                    var closeContent = top.$("#area").val() || $("#area").val();
                                                    let temp = /^\d+$/; // 非负整数
                                                    if (!temp.test(closeContent)) {
                                                        layer.msg('只能为整数');return false;
                                                    }
                                                    if (closeContent) {
                                                        $("#contractDays").val(closeContent);
                                                        $("#contractDate").val(getFormatDate());
                                                    }
                                                    layer.close(index);
                                                },
                                                no: function (index, layero) {
                                                }
                                            });
                                        }, 1000)
                                    }
                                    $(e).parent().find(".upfinish").removeClass("layui-btn-disabled").attr("disabled", false);
                                    $(fileContainer).append("    <li class=\"clearfix form-file-div form-file-div-" + type + "\">" +
                                        "                            <input type=\"checkbox\" class=\"fl\"  style=\"display: inline-block;\" lay-ignore>\n" +
                                        "                            <span class=\"fl ml10\">" + res.data.fileName + "</span>\n" +
                                        '                            <input type="hidden" class="' + type + '-input" name="tempFormFileIds[' + newIndex + ']" value="' + newFileId + '" />' +
                                        "                        </li>");
                                } else {
                                    if (res.msg) {
                                        layer.msg(res.msg, {icon: 2})
                                    } else {
                                        layer.msg("上传失败", {icon: 2})
                                    }
                                }
                            },
                            container: fileContainer
                            // fileOrder: 'desc'
                        };
                        _form_file.upload.bind(uploadPara);
                    })
                },
                oabindSelectInit: function () {
                    if(_oa_data.length == 0){
                        layerAjaxGet("/supplier/projectManager/oaInfoEnterfaceQuery",undefined,undefined,function(res){
                            if(res && res.count && res.count>0){
                                _oa_data = res.data;
                                ///获取到了数据:
                                _crt_page.events.bindSelectTable(_oa_data);
                                tableSelect_already = true;
                            }
                        })
                    }else{
                        _crt_page.events.bindSelectTable(_oa_data);
                    }
                    $(".layui-anim-upbit").css("width", "80%");
                    $(".layui-anim-upbit").css("left", "0px");
                },
                bindSelectTable: function(tableData){
                    tableSelect.render({
                        elem: '#oaselecttable',
                        searchKey: ['xmmc','htmc'],
                        searchPlaceholder: ['项目名称搜索','合同名称搜索'],
                        isZdy:'1',  // 是否走自定义方法; 如为1走自定义方法
                        table: {
                            // url: '/supplier/projectManager/oaInfoEnterfaceQuery',
                            data: tableData,
                            cols: [
                                [
                                    {type: 'radio',width: '5%'}
                                    , {field: 'id', hide: true}
                                    , {field: 'xmmc', title: '项目名称', width: '30%', align: 'center'}
                                    , {field: 'htmc', title: '合同名称', width: '30%', align: 'center'}
                                    , {field: 'htlx', title: '合同类型', width: '15%', align: 'center'}
                                    , {field: 'sqrq', title: '合同申请日期', width: '20%', align: 'center'}
                                    , {field: 'xmbh', title: '项目编号', width: '5%', align: 'center', hide: true}
                                    , {field: 'ywht', title: '有无合同', width: '5%', align: 'center', hide: true}
                                    , {field: 'htbh', title: '合同编号', width: '10%', align: 'center', hide: true}
                                    , {field: 'htlx', title: '合同类型', width: '10%', align: 'center', hide: true}
                                    , {field: 'sfysfk', title: '是否有首付款', width: '10%', align: 'center', hide: true}
                                    , {field: 'htje', title: '合同金额', width: '10%', align: 'center', hide: true}
                                    , {field: 'ssxmtze', title: '项目投资额', width: '10%', align: 'center', hide: true}
                                    , {field: 'jlfs', title: '监理方式', width: "200px", align: 'center', hide: true},
                                    , {field: 'jlf', title: '监理费', width: "200px", align: 'center', hide: true}
                                    , {field: 'zxf', title: '咨询费', width: "200px", align: 'center', hide: true}
                                    , {field: 'jcf', title: '检测费', width: "200px", align: 'center', hide: true}
                                    , {field: 'gq', title: '工期', align: 'center', hide: true}
                                    , {field: 'hy', title: '行业', align: 'center', hide: true}
                                    , {field: 'sheng', title: '省', align: 'center', hide: true}
                                    , {field: 'shi', title: '市', align: 'center', hide: true}
                                    , {field: 'xsry', title: '销售人员', align: 'center', hide: true}
                                    , {field: 'khmc', title: '客户名称', align: 'center', hide: true}
                                    , {field: 'khlxr', title: '客户联系人', align: 'center', hide: true}
                                    , {field: 'lxrzw', title: '联系人职务', align: 'center', hide: true}
                                    , {field: 'khlxfs', title: '客户联系方式', align: 'center', hide: true}
                                    , {field: 'ssdwmc', title: '实施单位名称', align: 'center', hide: true}
                                    , {field: 'ssdwlxr', title: '实施单位联系人', align: 'center', hide: true}
                                    , {field: 'ssdwlxfs', title: '实施单位联系方式', align: 'center', hide: true}
                                    , {field: 'sfbhqtyw', title: '是否包含其他业务', align: 'center', hide: true},
                                    {field: 'ydyjjcsj', title: '约定预计进场时间', align: 'center', hide: true},
                                    {field: 'rsgt', title: '人数沟通', align: 'center', hide: true}
                                ]
                            ],
                            page: true,
                            done: function (res, currentCount) {
                                //分页条数的宽度
                                $(".layui-table-page select").css("width","71px");
                            }
                        },
                        /*自定义查询方法*/
                        searchCustomFunction: function(searchData){
                            var search_key_xmmc = searchData.xmmc;
                            var search_key_htmc = searchData.htmc;
                            if(!search_key_xmmc && !search_key_htmc){
                                return _oa_data;
                            }
                            var search_result = [];
                            /*两个参数都不为空*/
                            if(_oa_data && _oa_data.length>0 && search_key_xmmc && search_key_htmc){
                                for(var a=0;a<_oa_data.length;a++){
                                    var a_oa_data = _oa_data[a];
                                    var a_oa_proj_xmmc = a_oa_data.xmmc;
                                    var a_oa_proj_htmc = a_oa_data.htmc;
                                    if(a_oa_proj_xmmc && (a_oa_proj_xmmc.indexOf(search_key_xmmc) != -1) && a_oa_proj_htmc && (a_oa_proj_htmc.indexOf(search_key_htmc) != -1)){
                                        search_result.push(a_oa_data);
                                    }
                                    if(a == (_oa_data.length-1)){
                                        return search_result;
                                    }
                                }
                            }
                            if(_oa_data && _oa_data.length>0 && search_key_xmmc && !search_key_htmc){
                                for(var a=0;a<_oa_data.length;a++){
                                    var a_oa_data = _oa_data[a];
                                    var a_oa_proj_xmmc = a_oa_data.xmmc;
                                    if(a_oa_proj_xmmc && (a_oa_proj_xmmc.indexOf(search_key_xmmc) != -1)){
                                        search_result.push(a_oa_data);
                                    }
                                    if(a == (_oa_data.length-1)){
                                        return search_result;
                                    }
                                }
                            }
                            if(_oa_data && _oa_data.length>0 && search_key_htmc && !search_key_xmmc){
                                for(var a=0;a<_oa_data.length;a++){
                                    var a_oa_data = _oa_data[a];
                                    var a_oa_proj_htmc = a_oa_data.htmc;
                                    if(a_oa_proj_htmc && (a_oa_proj_htmc.indexOf(search_key_htmc) != -1)){
                                        search_result.push(a_oa_data);
                                    }
                                    if(a == (_oa_data.length-1)){
                                        return search_result;
                                    }
                                }
                            }
                        },
                        searchTableDataFunction: function(searchData){
                            var search_key = searchData.xmmc;
                            if(!search_key){
                                return _oa_data;
                            }
                            var search_result = [];
                            if(_oa_data && _oa_data.length>0 && search_key){
                                for(var a=0;a<_oa_data.length;a++){
                                    var a_oa_data = _oa_data[a];
                                    var a_oa_proj_xmmc = a_oa_data.xmmc;
                                    if(a_oa_proj_xmmc && (a_oa_proj_xmmc.indexOf(search_key) != -1)){
                                        search_result.push(a_oa_data);
                                    }
                                    if(a == (_oa_data.length-1)){
                                        return search_result;
                                    }
                                }
                            }
                        },
                        done: function (elem, data) {
                            // 点击选择后显示清除按钮
                            $('#clearoaselecttable').css("display","inline-block");
                            var NEWJSON = [];
                            layui.each(data.data, function (index, item) {
                                var oaId = item.id;
                                $("#oaId").val(oaId);
                                $(".xmlxdiv").find("[type='checkbox']").each(function (i, v) {
                                    $(v).attr("checked", false)
                                })
                                //合同类型--项目类型
                                var htlx = item.htlx;
                                // 判断是否包含 + 若包含就分割字符串，回显多个项目类型
                                if (htlx.indexOf("+") != -1){
                                    var split = htlx.split("+");
                                    for (let i = 0; i < split.length; i++) {
                                        const splitElement = split[i];
                                        if (splitElement.indexOf("监理") > -1) {
                                            var object = $(".xmlxdiv").find("[name='projectType0']");
                                            object.click();
                                        } else if (splitElement.indexOf("咨询") > -1) {
                                            var object = $(".xmlxdiv").find("[name='projectType1']");
                                            object.click();
                                        } else if (splitElement.indexOf("检测") > -1) {
                                            var object = $(".xmlxdiv").find("[name='projectType2']");
                                            object.click();
                                        } else if (splitElement.indexOf("其他") > -1) {
                                            var object = $(".xmlxdiv").find("[name='projectType3']");
                                            object.click();
                                        }
                                    }
                                }else {
                                    if (htlx.indexOf("监理") > -1) {
                                        var object = $(".xmlxdiv").find("[name='projectType0']");
                                        object.click();
                                    } else if (htlx.indexOf("咨询") > -1) {
                                        var object = $(".xmlxdiv").find("[name='projectType1']");
                                        object.click();
                                    } else if (htlx.indexOf("检测") > -1) {
                                        var object = $(".xmlxdiv").find("[name='projectType2']");
                                        object.click();
                                    } else if (htlx.indexOf("其他") > -1) {
                                        var object = $(".xmlxdiv").find("[name='projectType3']");
                                        object.click();
                                    }
                                }
                                //合同编号--contractNo
                                var htbh = item.htbh;
                                $("#insideContractNo").val(htbh);
                                var xmbh = item.xmbh;
                                $("#payOrProjectNo").val(xmbh);
                                $("#owerCompany").val(item.khmc);
                                $("#projectLeader").val(item.khlxr);
                                //合同名称--jlHtName
                                var htmc = item.htmc;
                                $("#jlHtName").val(htmc);

                                //项目名称
                                var projectName = item.xmmc;
                                $("#projectName").val(projectName);
                                //投资额
                                var xmtze = item.ssxmtze;
                                if (xmtze) {
                                    $("#tzMoney").val(xmtze);
                                }

                                //合同金额
                                var htje = item.htje;
                                if (htje) {
                                    $("#htMoney").val(htje);
                                }
                                //监理费
                                var jlf = item.jlf;
                                if (jlf) {
                                    var jlFwMoney = $("#jlFwMoney");
                                    jlFwMoney.val(jlf);
                                    _crt_page.events.ssfybulur(jlFwMoney);
                                }
                                //咨询费
                                var zxf = item.zxf;
                                if (zxf) {
                                    var zxFwMoney = $("#zxFwMoney");
                                    zxFwMoney.val(zxf);
                                    _crt_page.events.ssfybulur(zxFwMoney);

                                }
                                //检测费
                                var jcf = item.jcf;
                                if (jcf) {
                                    var jcFwMoney = $("#jcFwMoney");
                                    jcFwMoney.val(jcf);
                                    _crt_page.events.ssfybulur(jcFwMoney);
                                }
                                //项目编号
                                var xmbh = item.xmbh;
                                if (xmbh) {
                                    $("#payOrProjectNo").val(xmbh);
                                }


                                //监理方式
                                var jlfs = item.jlfs;
                                /*       全过程监理 002
                                       验收式监 004
                                       阶段式监理 001
                                       驻场服务式监理 003*/


                                if (jlfs.indexOf("全过程") > -1) {
                                    $("#checkShape").val("002");
                                } else if (jlfs.indexOf("验收式") > -1) {
                                    $("#checkShape").val("004");
                                } else if (jlfs.indexOf("阶段式") > -1) {
                                    $("#checkShape").val("001");
                                } else if (jlfs.indexOf("驻场") > -1) {
                                    $("#checkShape").val("003");
                                }

                                //客户名称
                                var khmc = item.khmc;
                                if (khmc) {
                                    $("#owerCompany").val(khmc);
                                }

                                //业主单位联系人
                                var khlxr = item.khlxr;
                                if (khlxr) {
                                    $("#projectLeader").val(khmc);
                                }
                                //业主单位联系人职务
                                var lxrzw = item.lxrzw;
                                if (lxrzw) {
                                    $("#duty").val(lxrzw);
                                }
                                //约定预计进场时间
                                var ydyjjcsj = item.ydyjjcsj;
                                if (ydyjjcsj) {
                                    // $("#gqBeginDate").val(ydyjjcsj);
                                }
                                //工期
                                var gq = item.gq;
                                if (gq) {
                                    $("#gqReq").val(gq);
                                }
                            })
                        }
                    })
                    $(".layui-anim-upbit").css("width", "80%");
                    $(".layui-anim-upbit").css("left", "0px");
                },

                finishfile: function (object) {
                    debugger;
                    var length = $(object).parents(".uploadli").find("ul").find("li").length;
                    if (length == 0) {
                        layer.msg("请上传文件", {icon: 2})
                        return;
                    }

                    var fileDataStr = $(object).parent().find(".file-upload ").attr('filedata');
                    //至少fileData中需要有文件的类型编码
                    var fileData = eval('(' + fileDataStr + ')');
                    var finishId = fileData.type + "finish";
                    $("#" + finishId).val("1");
                    layer.msg("操作成功", {icon: 1});

                },
                delFile: function (object) {
                    var checkbox = $(object).parents(".uploadli").find("ul").find("li").find("input:checked");
                    if (checkbox.length == 0) {
                        layer.msg("请选择文件", {icon: 2});
                        return;
                    }
                    var ids = [];
                    console.log(checkbox);
                    checkbox.each(function (i, v) {
                        console.log($(v).parents("li").find("[type=\"hidden\"]"))
                        var _a = $(v).parents("li .form-file-div-312").find("[type=\"hidden\"]").attr("value");
                        console.log(_a);
                        ids.push(_a);
                    });
                    var ids = ids.join(',');
                    layer.confirm('确定删除文件吗？', function (index) {
                        layerAjax('/supplier/deleteFile', {"ids": ids}, '', function (d) {
                            if (d.flag) {
                                checkbox.each(function (i, v) {
                                    $(v).parent().remove();
                                });
                                layer.msg("删除成功！");
                            } else {
                                layer.msg(d.msg, {icon: 2});
                            }
                        });
                    });

                },
                saveBeforeBjy: function (data) {
                    var isTg = true;
                    var lxlength = $(".xmlxdiv").find("[type='checkbox']:checked").length;
                    if (lxlength == 0) {
                        $('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
                        $('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
                        layer.msg("请选择项目类型", {icon: 2});
                        isTg = false;
                        return isTg;
                    }
                    var lxsz = [];
                    $(".xmlxdiv").find("[type='checkbox']:checked").each(function (i, v) {
                        var lxvalue = $(v).attr("value");
                        lxsz.push(lxvalue);
                    });

                    lxsz = lxsz.join(',');
                    data.field.projectType = lxsz;
                    var dobest = [];
                    $(".doBestInput:checked").each(function (i, v) {
                        var value = $(v).attr("value");
                        dobest.push(value);
                    });
                    dobest = dobest.join(',');
                    data.field.mainFzField = dobest;
                    if (!data.field.needZb) {
                        data.field.needZb = "";
                    }
                    if (!data.field.isZb) {
                        data.field.isZb = "";
                    }
                    if (!data.field.qdHt) {
                        data.field.qdHt = "";
                    }
                    if (!data.field.isSfk) {
                        data.field.isSfk = "";
                    }
                    return isTg;
                },
                saveBefore: function (data) {
                    var isTg = true;
                    var lxlength = $(".xmlxdiv").find("[type='checkbox']:checked").length;
                    if (lxlength == 0) {
                        $('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
                        $('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
                        layer.msg("请选择项目类型", {icon: 2});
                        isTg = false;
                        return isTg;
                    }
                    var gklength = $(".divisgk").find("[type='radio']:checked").length;
                    if (gklength == 0) {
                        $('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
                        $('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
                        layer.msg("请选择是否对外公开", {icon: 2});
                        isTg = false;
                        return isTg;
                    }

                    var zbchecklenght = $(".divneedzb").find("[type='radio']:checked").length;
                    if (zbchecklenght == 0) {
                        $('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
                        $('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
                        layer.msg("请选择是否需要招投标", {icon: 2});
                        isTg = false;
                        return isTg;
                    } else {
                        if ($(".divneedzb").find("[type='radio']:checked").attr("value") == "1") {
                            var zbchecklenght = $(".LIisZb").find("[type='radio']:checked").length;
                            if (zbchecklenght == 0) {
                                $('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
                                $('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
                                layer.msg("请选择是否已招标", {icon: 2});
                                isTg = false;
                                return isTg;
                            } else {
                                var isZb = $(".LIisZb").find("[type='radio']:checked").attr("value");
                                if (isZb == "1") {
                                    var htchecklenght = $(".LIqdHt").find("[type='radio']:checked").length;
                                    if (htchecklenght == 0) {
                                        $('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
                                        $('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
                                        layer.msg("请选择是否已签合同", {icon: 2});
                                        isTg = false;
                                        return isTg;
                                    } else {
                                        var issdHt = $(".LIqdHt").find("[type='radio']:checked").attr("value");
                                        if (issdHt == "1") {
                                            var sfkchecklenght = $(".sfk").find("[type='radio']:checked").length;
                                            if (sfkchecklenght == "0") {
                                                $('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
                                                $('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
                                                layer.msg("请选择是否有首付款", {icon: 2});
                                                isTg = false;
                                                return isTg;
                                            }
                                        }

                                    }

                                }

                            }
                        }
                    }
                    var lxsz = [];
                    $(".xmlxdiv").find("[type='checkbox']:checked").each(function (i, v) {
                        var lxvalue = $(v).attr("value");
                        lxsz.push(lxvalue);
                    });

                    lxsz = lxsz.join(',');
                    data.field.projectType = lxsz;
                    var dobest = [];
                    $(".doBestInput:checked").each(function (i, v) {
                        var value = $(v).attr("value");
                        dobest.push(value);
                    });
                    dobest = dobest.join(',');
                    data.field.mainFzField = dobest;
                    if (!data.field.needZb) {
                        data.field.needZb = "";
                    }
                    if (!data.field.isZb) {
                        data.field.isZb = "";
                    }
                    if (!data.field.qdHt) {
                        data.field.qdHt = "";
                    }
                    if (!data.field.isSfk) {
                        data.field.isSfk = "";
                    }
                    return isTg;


                },
                ssfybulur: function (object) {
                    var ssfy = $(object).val();
                    var ssblper = '${ssblper}';
                    if (ssfy) {
                        var fwfy = (ssfy * ssblper).toFixed(2);
                        $(object).parent().next().find("input").val(fwfy);
                    }

                },
                clearSelect: function () {
                    window.location.reload();

                },
                xmlxChange: function (object) {
                    var lxvalue = $(object).attr("value");
                    if ($(object).prop("checked")) {
                        $(".lx" + lxvalue).attr("style", "display:block;")
                        $(".lx" + lxvalue).find("input").attr("lay-verify", "required|decimal|maxlength")
                    } else {
                        $(".lx" + lxvalue).attr("style", "display:none;")
                        $(".lx" + lxvalue).find("input").removeAttr("lay-verify");
                        $(".lx" + lxvalue).find("input").val("");
                    }
                    var lxlength = $(".xmlxdiv").find("[type='checkbox']:checked").length;
                    var lxsz = [];
                    $(".xmlxdiv").find("[type='checkbox']:checked").each(function (i, v) {
                        var lxvalue = $(v).attr("value");
                        lxsz.push(lxvalue);
                    });
                    $(".xmlxdiv").find("[type='checkbox']").each(function (i, v) {
                        var ischecked = $(v).prop("checked");
                        var lxvalue = $(v).attr("value");
                        if(!ischecked){
                            $(".lx" + lxvalue).attr("style", "display:none;")
                            $(".lx" + lxvalue).find("input").removeAttr("lay-verify");
                            $(".lx" + lxvalue).find("input").val("");
                        }

                    });
                    lxsz = lxsz.join(',');

                },
                needZtbChange: function (object) {
                    var lxvalue = $(object).attr("value");
                    if ($(object).prop("checked") && lxvalue == '1') {
                        $(".LIisZb").css({"display": "block", "width": "60%"});
                        $(".upload_zbtzs_li").css({"display": "block"});
                    } else {
                        // 是否招标不显示
                        $(".LIisZb").attr("style", "display:none;");
                        $(".LIisZb").find("input").prop('checked', false);
                        $(".upload_zbtzs_li").attr("style", "display:none;");
                        $(".upload_zbtzs_li").find("input").prop('checked', false);
                        $(".LIqdHt").css({"display": "block", "width": "60%"});
                        $(".LIqdHt").find("input").prop('disabled', false);
                        /*             $(".LIqdHt").attr("style","display:none;")
                                     $(".LIqdHt").find("input").prop('checked',false);
                                     $(".sfk").attr("style","display:none;")
                                     $(".sfk").find("input").prop('checked',false);
                                     $(".htqdhj").attr("style","display:none;")
                                     $(".htqdhj").find("input").val("");*/
                    }
                    _crt_page.events.radioChange();
                },
                isZbChange: function (object) {
                    var lxvalue = $(object).attr("value");
                    if ($(object).prop("checked") && lxvalue == '1') {
                        $(".LIqdHt").css({"display": "block", "width": "60%"});
                        $(".LIqdHt").find("input").prop('disabled', false);
                    } else {
                        //是否已签合同（默认“否”，不可修改）
                        $(".LIqdHt").css({"display": "block", "width": "60%"});
                        $(".LIqdHt").find("input").prop('checked', true);
                        $(".LIqdHt").find("input").prop('disabled', true);

                        $(".sfk").attr("style", "display:none;")
                        $(".sfk").find("input").prop('checked', false);
                        $(".htqdhj").attr("style", "display:none;")
                        $(".htqdhj").find("input").removeAttr("lay-verify")
                        $(".htqdhj").find("input").val("");
                    }
                    _crt_page.events.radioChange();
                },
                qdHtChange: function (object) {
                    var lxvalue = $(object).attr("value");
                    if ($(object).prop("checked") && lxvalue == '1') {
                        $(".sfk").css({"display": "block", "width": "60%"});
                        $(".htqdhj").css({"display": "block", "width": "60%"});
                        $(".htqdhj").find("input").attr("lay-verify", "required")
                    } else {
                        $(".sfk").attr("style", "display:none;")
                        $(".sfk").find("input").prop('checked', false);
                        $(".htqdhj").find("input").removeAttr("lay-verify")
                        $(".htqdhj").attr("style", "display:none;")
                        $(".htqdhj").find("input").val("");
                    }
                    _crt_page.events.radioChange();
                },
                radioChange: function () {
                    // (1) ，则显示 “上传项目招标文件”、“上传项目投标文件”、“上传合同


                    var ztb = $(".divneedzb").find("[type='radio']:checked").attr("value");
                    var iszb = $(".LIisZb").find("[type='radio']:checked").attr("value");
                    var qdht = $(".LIqdHt").find("[type='radio']:checked").attr("value");
                    if (ztb == "1" && iszb == "1" && qdht == "1") {
                        //  则显示 “上传项目招标文件”、“上传项目投标文件”、“上传合同”。
                        $(".upload_zbwj_li").css('display', 'block');
                        $(".upload_tbwj_li").css('display', 'block');
                        $(".upload_ht_li").css('display', 'block');


                        $(".upload_zbwjsmw_li").find("ul").find("li").remove();
                        $(".upload_htsmwj_li").find("ul").find("li").remove();
                        $(".upload_zbwjsmw_li").css('display', 'none');
                        $(".upload_htsmwj_li").css('display', 'none');
                    }
                    if (ztb == "1" && iszb == "1" && qdht == "0") {
                        //  则显示 “上传项目招标文件”、“上传项目投标文件”、“上传合同”。
                        $(".upload_zbwj_li").css('display', 'block');
                        $(".upload_tbwj_li").css('display', 'block');
                        $(".upload_htsmwj_li").css('display', 'block');


                        $(".upload_zbwjsmw_li").find("ul").find("li").remove();
                        $(".upload_ht_li").find("ul").find("li").remove();
                        $(".upload_zbwjsmw_li").css('display', 'none');
                        $(".upload_ht_li").css('display', 'none');

                    }
                    if (ztb == "1" && iszb == "0" && qdht == "0") {
                        //  “上传项目招标文件说明文件”、“上传合同说明文件”
                        $(".upload_zbwjsmw_li").css('display', 'block');
                        $(".upload_htsmwj_li").css('display', 'block');


                        $(".upload_zbwj_li").find("ul").find("li").remove();
                        $(".upload_tbwj_li").find("ul").find("li").remove();
                        $(".upload_ht_li").find("ul").find("li").remove();
                        $(".upload_zbwj_li").css('display', 'none');
                        $(".upload_tbwj_li").css('display', 'none');
                        $(".upload_ht_li").css('display', 'none');
                    }
                    if (ztb == "0" && qdht == "1") {
                        //  “上传项目招标文件说明文件”、“上传合同说明文件”
                        $(".upload_ht_li").css('display', 'block');


                        $(".upload_zbwjsmw_li").find("ul").find("li").remove();
                        $(".upload_htsmwj_li").find("ul").find("li").remove();
                        $(".upload_zbwj_li").find("ul").find("li").remove();
                        $(".upload_tbwj_li").find("ul").find("li").remove();
                        $(".upload_zbwjsmw_li").css('display', 'none');
                        $(".upload_htsmwj_li").css('display', 'none');
                        $(".upload_zbwj_li").css('display', 'none');
                        $(".upload_tbwj_li").css('display', 'none');
                    }
                    if (ztb == "0" && qdht == "0") {
                        //  “上传项目招标文件说明文件”、“上传合同说明文件”
                        $(".upload_htsmwj_li").css('display', 'block');

                        $(".upload_zbwj_li").find("ul").find("li").remove();
                        $(".upload_tbwj_li").find("ul").find("li").remove();
                        $(".upload_ht_li").find("ul").find("li").remove();
                        $(".upload_zbwjsmw_li").find("ul").find("li").remove();

                        $(".upload_zbwj_li").css('display', 'none');
                        $(".upload_tbwj_li").css('display', 'none');
                        $(".upload_ht_li").css('display', 'none');
                        $(".upload_zbwjsmw_li").css('display', 'none');
                    }

                },
                provinceChange: function (object) {
                    var code = $(object).find('option:selected').val();
                    if (code == "") {
                        return;
                    }
                    layerAjaxGet('/sys/register/getOrganize', {"code": code}, '', function (d) {
                        if (d.flag == true) {
                            $(object).next().empty().append("<option value=''>选择市</option>");
                            for (var i = 0; i < d.data.length; i++) {
                                $(object).next().append("<option value='" + d.data[i].code + "'>" + d.data[i].name + "</option>");
                            }
                        } else {
                            layer.msg(d.msg, {icon: 2});
                        }
                    });


                },
                cityChange: function (object) {
                    var code = $(object).find('option:selected').val();
                    if (code == "") {
                        return;
                    }
                    layerAjaxGet('/sys/register/getOrganize', {"code": code}, '', function (d) {
                        if (d.flag == true) {
                            $(object).next().empty().append("<option value=''>选择区县</option>");
                            for (var i = 0; i < d.data.length; i++) {
                                $(object).next().append("<option value='" + d.data[i].code + "'>" + d.data[i].name + "</option>");
                            }
                        } else {
                            layer.msg(d.msg, {icon: 2});
                        }
                    });


                },
                personPlaceProvinceInit: function () {
                    $(".mainpersonplace").find("div").each(function (i, v) {
                        var provinceId = $(v).find("select:first").attr("id");
                        var cityId = $(v).find("select:eq(1)").attr("id");
                        $("#" + provinceId).change(function () {
                            var code = $('#' + provinceId + ' option:selected').val();
                            if (code == "") {
                                return;
                            }
                            layerAjaxGet('/sys/register/getOrganize', {"code": code}, '', function (d) {
                                if (d.flag == true) {
                                    $("#" + cityId).empty().append("<option value=''>选择市</option>");
                                    for (var i = 0; i < d.data.length; i++) {
                                        $("#" + cityId).append("<option value='" + d.data[i].code + "'>" + d.data[i].name + "</option>");
                                    }
                                } else {
                                    layer.msg(d.msg, {icon: 2});
                                }
                            });

                        });
                    });
                },
                placeCityInit: function () {
                    $(".ssplace").find("div").each(function (i, v) {
                        var cityId = $(v).find("select:eq(1)").attr("id");
                        var countyId = $(v).find("select:eq(2)").attr("id");
                        $("#" + cityId).change(function () {
                            var code = $('#' + cityId + ' option:selected').val();
                            if (code == "") {
                                return;
                            }
                            layerAjaxGet('/sys/register/getOrganize', {"code": code}, '', function (d) {
                                if (d.flag == true) {
                                    $("#" + countyId).empty().append("<option value=''>选择区县</option>");
                                    for (var i = 0; i < d.data.length; i++) {
                                        $("#" + countyId).append("<option value='" + d.data[i].code + "'>" + d.data[i].name + "</option>");
                                    }
                                } else {
                                    layer.msg(d.msg, {icon: 2});
                                }
                            });

                        });
                    });

                },
                resetPlace: function () {
                    /*  $(".ssplace").find(".addplaceimage:not(:last)").attr("style","display:none;")*/
                    $(".ssplace").find(".divplaceselect").each(function (i, v) {
                        $(v).find("select:eq(0)").attr("name", "projectPlacedtos[" + i + "].province")
                        $(v).find("select:eq(1)").attr("name", "projectPlacedtos[" + i + "].city");
                        $(v).find("select:eq(2)").attr("name", "projectPlacedtos[" + i + "].county");
                        $(v).find("select:eq(0)").attr("lay-filter", "projectPlacedtos[" + i + "].province");
                        $(v).find("select:eq(1)").attr("lay-filter", "projectPlacedtos[" + i + "].city");
                        $(v).find("select:eq(2)").attr("lay-filter", "projectPlacedtos[" + i + "].county");
                    });
                },
                resetPersonPlace: function () {
                    /*  $(".ssplace").find(".addplaceimage:not(:last)").attr("style","display:none;")*/
                    $(".mainpersonplace").find(".divpersonplaceselect").each(function (i, v) {
                        $(v).find("select:eq(0)").attr("name", "personPlacedtos[" + i + "].province")
                        $(v).find("select:eq(0)").attr("lay-filter", "personPlacedtos[" + i + "].province");
                        $(v).find("select:eq(1)").attr("name", "personPlacedtos[" + i + "].city");
                        $(v).find("select:eq(1)").attr("lay-filter", "personPlacedtos[" + i + "].city");

                    });
                },
                deletePlace: function (object) {
                    var placeLength = $(".ssplace").find(".divplaceselect").length;
                    if (placeLength == 1) {
                        layer.msg("实施地点不能全部删除", {icon: 2});
                    } else {
                        $(object).parent().remove();
                        _crt_page.events.resetPlace();
                    }

                },
                addPlace: function (object) {
                    $(object).parent().after(" <div class=\"clearfix mt10 divplaceselect\">\n" +
                        "                            <select name=\"projectPlacedtos[1].province\" class=\"ml8 fl\" id=\"placeprovince1\"   onchange=\"_crt_page.events.provinceChange(this)\"  style=\"width:90px !important;\"\n" +
                        "                                    lay-verify=\"required\" lay-ignore>\n" +
                        "                                <option value=\"\">请选择</option>\n" +
                        "                                <#list provincelist as vo>\n" +
                        "                                    <option value=\"${vo.code}\">${vo.name}</option>\n" +
                        "                                </#list>\n" +
                        "                            </select>\n" +
                        "                            <select name=\"projectPlacedtos[1].city\" id=\"placecity1\" class=\"ml8 fl\"  onchange=\"_crt_page.events.cityChange(this)\" lay-filter=\"projectPlacedtos[1].city\" lay-verify=\"required\"\n" +
                        "                                    style=\"width: 90px !important;margin-left: 10px\" lay-ignore>\n" +
                        "                                <option value=\"\">请选择</option>\n" +
                        "                            </select>\n" +
                        "                            <select name=\"projectPlacedtos[1].county\" id=\"placecounty1\" class=\"ml8 fl\" lay-filter=\"projectPlacedtos[1].county\" lay-verify=\"required\"\n" +
                        "                                    style=\"width:90px !important;margin-left: 10px\" lay-ignore>\n" +
                        "                                <option value=\"\">请选择</option>\n" +
                        "                            </select>\n" +
                        "                            <img src=\"${re.contextPath}/plugin/common/images/77@2x.png\" class=\"fl ml20 addplaceimage\" onclick=\"_crt_page.events.addPlace(this)\" >\n" +
                        "                            <img src=\"${re.contextPath}/plugin/common/images/76@2x.png\" class=\"fl ml20\" onclick=\"_crt_page.events.deletePlace(this)\">\n" +
                        "                        </div>");
                    _crt_page.events.resetPlace();

                },
                addPersonPlace: function (object) {
                    $(object).parent().after("\n" +
                        "                        <div class=\"clearfix mt10 divpersonplaceselect\">\n" +
                        "                            <select name=\"personPlacedtos[0].province\" class=\"ml8 fl\"   onchange=\"_crt_page.events.provinceChange(this)\" id=\"personplaceprovince0\" style=\"width:200px !important;\"\n" +
                        "                                    lay-verify=\"required\" lay-ignore>\n" +
                        "                                <option value=\"\">请选择</option>\n" +
                        "                                <#list provincelist as vo>\n" +
                        "                                    <option value=\"${vo.code}\">${vo.name}</option>\n" +
                        "                                </#list>\n" +
                        "                            </select>\n" +
                        "                            <select name=\"personPlacedtos[0].city\" id=\"personplacecity0\" class=\"ml8 fl\" lay-filter=\"city\" lay-verify=\"required\"\n" +
                        "                                    style=\"width: 200px !important;margin-left: 10px\" lay-ignore>\n" +
                        "                                <option value=\"\">请选择</option>\n" +
                        "                            </select>\n" +
                        "                            <img src=\"${re.contextPath}/plugin/common/images/77@2x.png\" class=\"fl ml20\" onclick=\"_crt_page.events.addPersonPlace(this)\">\n" +
                        "                            <img src=\"${re.contextPath}/plugin/common/images/76@2x.png\" class=\"fl ml20\" onclick=\"_crt_page.events.deletePersonPlace(this)\">\n" +
                        "                        ");
                    _crt_page.events.resetPersonPlace();
                },
                deletePersonPlace: function (object) {
                    var placeLength = $(".mainpersonplace").find(".divpersonplaceselect").length;
                    if (placeLength == 1) {
                        $(".mainpersonplace").find(".divpersonplaceselect").find("select").val("");
                    } else {
                        $(object).parent().remove();
                        _crt_page.events.resetPersonPlace();
                    }

                },
                chooseOaProject: function(){
                    console.log(tableSelect_already);
                    if(!tableSelect_already){
                        if(!getDataLoading){
                            getDataLoading = layer.msg('加载OA系统数据中,请稍后。。。', {
                                icon: 16
                                , shade: 0.2,
                                time: false
                            });
                        }
                        setTimeout(function(){
                            $('#oaselecttable').click();
                        },1000);
                    }else{
                        layer.close(getDataLoading);
                        if(!auto_clicked){
                            auto_clicked = true;
                            $('#oaselecttable').click();
                        }
                    }
                }
            }
        };
        _crt_page.init();
    });

    //发布指南
    function handbook() {
        var w, h;
        if (w == null || w == '') {
            w = ($(window).width() * 0.92);
        }
        ;
        if (h == null || h == '') {
            h = ($(window).height() - 80);
        }
        layer.open({
            type: 2,
            title: '发布指南',
            shadeClose: true,
            shade: 0.8,
            maxmin: false,
            area: [w + 'px', h + 'px'],
            content: '/supplier/ruleCentre/publishGuide?badtCode=001&badtTypecode=FBZN001' //iframe的url
        });
    }

    //获取当前时间
    function getFormatDate() {
        var nowDate = new Date();
        var year = nowDate.getFullYear();
        var month = nowDate.getMonth() + 1 < 10 ? "0" + (nowDate.getMonth() + 1) : nowDate.getMonth() + 1;
        var date = nowDate.getDate() < 10 ? "0" + nowDate.getDate() : nowDate.getDate();
        var hour = nowDate.getHours() < 10 ? "0" + nowDate.getHours() : nowDate.getHours();
        var minute = nowDate.getMinutes() < 10 ? "0" + nowDate.getMinutes() : nowDate.getMinutes();
        var second = nowDate.getSeconds() < 10 ? "0" + nowDate.getSeconds() : nowDate.getSeconds();
        return year + "-" + month + "-" + date;
    }
    function resetRequired() {
        form.verify({
            required: function (v) {

            }
        })
    }

    function resetRequiredSubmit() {
        form.verify({
            required: function (v) {
                if (v == "") {
                    return "必填项不能为空";
                }
            }
        })
    }
    function tzym(){
        window.parent._delTabT('57d00e5a44b543d3902081cf7ce6efcb');
        window.parent._showtab('57d00e5a44b543d3902081cf7ce6efcb', '我的项目', '/supplier/projectManager/myproject');
        window.parent._delTabT('cf8c85d3685a48abb23a4104ef25997c');
    }
</script>
</body>

</html>
